package com.sky.controller.admin;

import com.sky.dto.EmployeeDTO;
import com.sky.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author wangqi
 * @date 2023/12/26 13:56
 */
@RestController
@Slf4j
public class NginxController {

    //访问url: http://localhost:8080/admin/test1
    @RequestMapping("/admin/test1")
    public String test1(){
        log.info("test1被访问了");
        return "nginx test";
    }

    @Autowired
    private Environment environment;

    @RequestMapping("/admin/nginx/test")
    public String hello(HttpServletRequest request){
        String property = environment.getProperty("server.port");
        log.info(property+"：端口被访问了");
        return "nginx test";
    }
}
